package org.elephantt.webby;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class RawResponder implements Responder {
  public void respond(HttpServletRequest request, HttpServletResponse response, Object controllerReturnValue) throws IOException {
    response.setStatus(HttpServletResponse.SC_OK);
    if (controllerReturnValue != null) {      
      response.getWriter().write(controllerReturnValue.toString());
    } else {
      response.setContentLength(0);
    }
  }
}